<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('bank_details_hangzhou', function (Blueprint $table) {
            $table->string('receipt_path')->nullable()->comment('回单存储路径（S3/COS）')->after('synced_at');
            $table->timestamp('receipt_retrieved_at')->nullable()->comment('回单取回时间')->after('receipt_path');

            $table->index(['receipt_retrieved_at'], 'idx_receipt_retrieved_at');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('bank_details_hangzhou', function (Blueprint $table) {
            $table->dropIndex('idx_receipt_retrieved_at');
            $table->dropColumn(['receipt_path', 'receipt_retrieved_at']);
        });
    }
};
